#自动控制鼠标
#来自于https://pyautogui.readthedocs.io/en/latest/
import pyautogui

screenWidth,screenHeight=pyautogui.size()   #Get the size of the primary monitor
print("screenWidth=",screenWidth,"screenHeight",screenHeight)
currentMouseX,currentMouseY=pyautogui.position()    #Get the XY position of the mouse.
print("currentMouseX=",currentMouseX,"currentMouseY",currentMouseY)#这个值为运行该程序时，鼠标所在的位置。

pyautogui.moveTo(100,160)   #Move the mouse to XY coordinates.
pyautogui.click()   #click the mouse.

pyautogui.doubleClick(100,160)    #Double click the mouse.
pyautogui.doubleClick(100,260)    #适用于公司里的桌面图标
#pyautogui.click("emwin.txt")   #Find where pypic6 appears on the screen and click it.这个貌似没啥用。

#pyautogui.move(0,10)    #move mouse 10 pixels down from its current position
pyautogui.doubleClick(100,160)
pyautogui.write("Hello world!",interval=0.25)#这个要移到有输入框的东西里才行。# type with quarter-second pause in between each key.

pyautogui.keyDown("shift")#Press the Shift-Key down and hold it.
pyautogui.press("A")#press the "a"
pyautogui.keyUp("shift")#Let go of the Shift key.

pyautogui.hotkey("ctrl","a")#Press the Ctrl+A hotkey combination.

pyautogui.alert("This is the message to display.")#Make an alert box appear and pause the program until OK is clicked


